Respond with 404 for invalid file references#7197
Respond with 404 for invalid file references#7197labkey-tchad merged 4 commits intorelease25.11-SNAPSHOTfrom
Conversation
|
I've added similar try/catch in a few places too. I wonder if we should automatically treat |
Not really, I guess internally they are different (still not sure we care), but I don't have an opinion about consolidating how we report errors via APIs. If reporting fewer exceptions is better (or more consistent across OS) that seems fine. |
|
New approach pushed. @labkey-tchad @labkey-matthewb take a look at your convenience. |
labkey-jeckels
left a comment
There was a problem hiding this comment.
@labkey-tchad I'll go ahead and self-approve. Please take a look before merging
Rationale
Introduce
InvalidPathReferenceExceptionto signify a path we don't want to handle, either because it has invalid characters or it's trying to escape its parent.The link crawler found this error when running on Windows due to the file system rejecting certain characters via
File.toPath. Similar errors can be reproduced on Mac/Linux by attempting to reference a parent path (/home/specimen-importSpecimenData.view?path=..)Stacktrace (Windows)
Stacktrace (Mac)
Related Pull Requests
Changes